﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.ServiceModel;


namespace ServeurRSS_1_0.Source.Model
{
    [DataContract]
    public class RssTree
    {

        public RssTree(DataDirectory self)
        {
            currentDir = self;
            subDir = new Dictionary<string,RssTree>();
            rssList = null;
        }

        [DataMember]
        public Dictionary<string, RssTree> subDir
        {get; set;}

        [DataMember]
        public DataDirectory currentDir
        {get; set;}

        [DataMember]
        public List<DataRss> rssList
        { get; set;}


        string addSubDir(DataDirectory newSubDir)
        {
            RssTree newDir = new RssTree(newSubDir);
            subDir.Add(newSubDir.name, newDir);
            return "OK";
        }

        string eraseSubDir(DataDirectory old)
        {
           
            subDir.Remove(old.name);
            return "OK";
        }

    }
}